package com.bjesc_b2c.app.appraiset.mvp.presenter.impl;

import android.content.Context;

import com.bjesc_b2c.app.appraiset.mvp.model.CarBrandModel;
import com.bjesc_b2c.app.appraiset.mvp.model.impl.CarBrandModelImpl;
import com.bjesc_b2c.app.appraiset.mvp.presenter.CarBrandPersenter;
import com.bjesc_b2c.app.appraiset.mvp.view.CarBrandView;

import java.util.List;

import master_bean.SelectCarBrandBean;

/**
 * Created by lenovo on 2017/3/1.
 */

public class CarBrandPersenterImpl implements CarBrandPersenter, CarBrandModelImpl.CallBack {
    private CarBrandView view;
    private CarBrandModel model;

    public CarBrandPersenterImpl(CarBrandView view) {
        this.view = view;
        this.model = new CarBrandModelImpl(this);
    }

    @Override
    public void getCarBrand() {
            model.reuestCarBrand((Context) view);
    }

    @Override
    public void callBack(List<SelectCarBrandBean> brandList) {
        if(brandList!=null && brandList.size() >0){
            view.resultCarBrand(brandList);
        }
    }
}
